﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObjects.BO_GetObjects;
using System.Data;
using LibraryO2S;

public partial class Controls_SettingGroupNew : Pages_Base
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        txtFullSettingGroupDescription.Text = "";
        txtFullSettingGroupName.Text = "";
        //txtSortDisplay.Text = "";
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            string name = txtFullSettingGroupName.Text.Trim();
            string description = txtFullSettingGroupDescription.Text.Trim();
            DataTable admin = (DataTable)Session["Admin"];
            string result = BO_SettingGroups.Insert(name, name, description, description, Convert.ToInt32(txtSortDisplay.Text), DateTime.Now, admin.Rows[0]["USER_NAME"].ToString(), DateTime.Now, "", true);
            if (result.Equals("0"))
                divMessage.InnerHtml = O2S_Message.Error("Thông Báo", "Lỗi trong quá trình chuyền tải dữ liệu.");
            else
                divMessage.InnerHtml = O2S_Message.Success("Thông Báo", "Thực hiện thành công.");
        }
        catch { }
        finally { }
    }
}